//
//  LogInViewController.m
//  Protect -A
//
//  Created by 付剑英 on 16/6/25.
//  Copyright © 2016年 付剑英. All rights reserved.
//

#import "LogInViewController.h"
#import "BaseTextField.h"
#import "BaseButton.h"
#import "DengluViewController.h"
#import "ZhuCeViewController.h"
@interface LogInViewController ()
@property (nonatomic,retain)BaseTextField *dengLu;
@property (nonatomic,retain)BaseTextField *miMa;
@property (nonatomic,retain)BaseButton *selectDenglu;
@property (nonatomic,retain)BaseButton *selectZhuCe;
@end

@implementation LogInViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self create];
    // Do any additional setup after loading the view.
}

#pragma mark - ------------ 创建控件 ---------------
-(void)create{
 
    self.dengLu = [[BaseTextField alloc]initWithFrame:CGRectMake(90,170, 200, 50)];
    [self.view addSubview:self.dengLu];
    self.dengLu.placeholder = @"请输入账号";
    self.dengLu.borderStyle = UITextBorderStyleRoundedRect;
    self.miMa = [[BaseTextField alloc]initWithFrame:CGRectMake(90, 240, 200, 50)];
    [self.view addSubview:self.miMa];
    self.miMa.placeholder = @"请输入密码";
    self.miMa.borderStyle = UITextBorderStyleRoundedRect;
    
    self.selectDenglu = [[BaseButton alloc]initWithFrame:CGRectMake(150, 310, 100, 50)];
    self.selectDenglu.backgroundColor = [UIColor redColor];
    [self.selectDenglu setTitle:@"登录" forState:UIControlStateNormal];
    [self.selectDenglu addTarget:self action:@selector(handleDenglu:) forControlEvents:UIControlEventTouchDown];
    [self.view addSubview:self.selectDenglu];
    
    self.selectZhuCe = [[BaseButton alloc]initWithFrame:CGRectMake(150, 370, 100, 50)];
    self.selectZhuCe.backgroundColor = [UIColor lightGrayColor];
    [self.selectZhuCe setTitle:@"注册" forState:UIControlStateNormal];
    [self.selectZhuCe addTarget:self action:@selector(handleZhuCe:) forControlEvents:UIControlEventTouchDown];
    [self.view addSubview: self.selectZhuCe];
    
}
#pragma mark - ------------ 登录点击事件 ---------------

-(void)handleDenglu:(BaseButton *)button{
   
    DengluViewController *denglu = [[DengluViewController alloc]init];
    
    [self.navigationController pushViewController:denglu animated:YES];
    
}

#pragma mark - ------------ 注册点击事件 ---------------


-(void)handleZhuCe:(BaseButton *)button{

    ZhuCeViewController *vc = [[ZhuCeViewController alloc]init];
    
    [self.navigationController pushViewController:vc animated:YES];
  

}





- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
